package com.dlwx.firefighting.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.dlwx.firefighting.R;
import com.dlwx.firefighting.bean.FxUserBean;

/**
 * Created by Administrator on 2017/9/6.
 */

public class FxUserAdapter extends ListBaseAdapter<FxUserBean> {
    private Context context;
    public FxUserAdapter(Context context) {
        super(context);
        this.context=context;
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_fx_user;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        FxUserBean bean = getDataList().get(position);
        TextView textView=holder.getView(R.id.name_tv);
        TextView loginTimeTv=holder.getView(R.id.tv_login_time);
        TextView regTimeTv=holder.getView(R.id.tv_reg_time);
        ImageView imageView=holder.getView(R.id.imageView);
        textView.setText(bean.getUser_name());
        loginTimeTv.setText("最近登录时间："+bean.getLast_login());
        regTimeTv.setText("注册时间："+bean.getReg_time());
        Glide.with(context).load(bean.getHeadimg()).error(R.mipmap.error_big).into(imageView);
    }
}
